import tkinter as tk
from tkinter import messagebox

class application(tk.Frame):
    def __init__(self,master=None):
        self.master=master
        super().__init__()
        self.creatApp()

    def login_(self):
        info="user={},pwd={}".format(self.v1.get(),self.v2.get())
        messagebox.showinfo("login",info)

    def creatApp(self):
        l01=tk.Label(self.master,text="user name",justify='left',width=10,font=("arial",18)).grid(row=1,column=1)
        self.v1=tk.StringVar()
        e1=tk.Entry(self.master,textvariable=self.v1,width=30)
        e1.grid(row=1,column=2)

        self.v2=tk.StringVar()
        l02=tk.Label(self.master,text="password",justify='left',width=10,font=("arial",18)).grid(row=2,column=1)
        e2=tk.Entry(self.master,textvariable=self.v2,width=30,show='*')
        e2.grid(row=2,column=2)

        btn01=tk.Button(self.master,text="login",font=("arial",18),width=10,command=self.login_).grid(row=3,column=2)

window=tk.Tk()
window.geometry('600x300')
window.title('login')
app=application(window)
window.mainloop()